package com.hgw.Demo07_FlyweightPattern.Exercises14_9_4;

/**
 * Data time:2021/12/15 21:10
 * StudentID:2019112118
 * Author:hgw
 * Description:
 */
public class Client {
    public static void main(String[] args) {
        NetworkEquipment com1,com2,com3,com4;
        NetworkEquipmentFactory factory;

        factory = NetworkEquipmentFactory.getInstance();

        com1 = factory.getNetworkEquipment("s");
        com2 = factory.getNetworkEquipment("s");
        System.out.println(com1==com2);
        com1.display();
        com2.display();

        com3 = factory.getNetworkEquipment("h");
        com4 = factory.getNetworkEquipment("h");
        System.out.println(com3==com4);
        com3.display();
        com4.display();
    }
}
